# -*- coding: utf-8 -*-
# @Time : 2021/5/19 9:51
# @Author : HEAD
# @Email : scg@gmail.com
# @File : run.py
# @Project : seleniumDemo
import os
import time
import unittest
from common.tools import archive_test_result
from BeautifulReport import BeautifulReport

ABS_PATH = os.path.dirname(os.path.abspath(__file__))


testsuite = unittest.defaultTestLoader.discover('cases')
filename = "{}{}.html".format("test-", time.strftime("%Y%m%d%H%M%S"))
runner = BeautifulReport(testsuite)
runner.report(report_dir='report',
              filename=filename,
              description='测试jenkins集成')
_filename = os.path.join(ABS_PATH, 'report', filename)
archive_test_result(_filename, ABS_PATH)
